import struct

key = b"^FStx,wl6NquAVRF@f%6\x00"

def unpack(packet:bytes):
    head = struct.unpack("!IcIII",packet[:17])
    body = packet[17:]
    return head,body

def decrypt(packet:bytes):
    ret = bytearray(len(packet)-1)
    keyindex = 0
    for index in range(len(ret)):
        ret[index] = ((packet[index] >> 5) | (packet[index+1] << 3) % 256)
        ret[index] = ret[index] ^ key[keyindex % len(key)]
        keyindex = keyindex + 1
        if keyindex == 22:
            keyindex = 0
    return ret

def encrypt(packet:bytes):
    ret = bytearray(len(packet)+1)
    keyindex = 0
    for index in range(len(packet)):
        ret[index] = packet[index] ^ key[keyindex % len(key)]
        keyindex = keyindex + 1
        if keyindex == 22:
            keyindex = 0
    for index in range(len(ret)-1,0,-1):
        ret[index] = ret[index] | (ret[index-1] >> 3)
        ret[index-1] = (ret[index-1] << 5) % 256
    ret[0] = ret[0] | 3
    return ret

#print(decrypt(encrypt(bytes.fromhex("00000000000000023130"))).hex())
print(decrypt(unpack(bytes.fromhex(input()))[1]))